package com.bstek.controller;

import com.bstek.model.domain.MisDepartment;
import com.bstek.model.domain.MisUser;
import com.bstek.service.MisDepartmentService;
import org.springframework.web.bind.annotation.*;

import javax.inject.Inject;
import java.util.List;
import java.util.Map;

@RestController
public class MisDepartmentController {

    @Inject
    MisDepartmentService misDepartmentService;

    @RequestMapping(value = "mis/department/getDepts" , method = RequestMethod.GET)
    private Map<String,Object> getDepts(@RequestParam Map<String, Object> params){
        return  misDepartmentService.getDept();
    }

    @RequestMapping(value = "mis/department/saveDepartment" , method = RequestMethod.POST)
    public int saveMisUser(@RequestBody MisDepartment misDepartment){
        return misDepartmentService.saveDepartment(misDepartment);
    }

    @RequestMapping(value = "mis/department/updateDepartment" , method = RequestMethod.PUT)
    public int updateDepartment(@RequestBody MisDepartment misDepartment){
        return misDepartmentService.updateDepartment(misDepartment);
    }

    @RequestMapping(value = "mis/department/delDepartmentById" , method = RequestMethod.POST)
    public int delDepartmentById(@RequestBody Map<String, Object> map){
        return  misDepartmentService.delDepartmentById(map);
    }

}
